package com.xjrsoft.module.workflow.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.core.secure.XjrUser;
import com.xjrsoft.module.workflow.dto.GetPageListNwfTaskDto;
import com.xjrsoft.module.workflow.dto.NwfSchemeInfoDto;
import com.xjrsoft.module.workflow.entity.XjrNwfSchemeinfo;
import com.xjrsoft.module.workflow.vo.NwfSchemeInfoVo;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

public interface IXjrNwfSchemeInfoService extends IService<XjrNwfSchemeinfo> {
    /**
     * @Author:湘北智造-框架开发组
     * @Date:2020/10/26
     * @Param:[idValue]
     * @return:com.xjrsoft.module.workflow.entity.XjrNwfSchemeinfo
     * @Description:根据模板Id查询
     */
    XjrNwfSchemeinfo getByModelId(String idValue);

    /**
     * @Author:湘北智造-框架开发组
     * @Date:2020/11/7
     * @Param:[idValue]
     * @return:com.xjrsoft.module.workflow.entity.XjrNwfSchemeinfo
     * @Description:根据部署Id查询
     */
    XjrNwfSchemeinfo getByDeploymentId(String idValue);

    /**
     * @Author:湘北智造-框架开发组
     * @Date:2020/10/20
     * @Param:[iPage, xjrNwfSchemeinfo]
     * @return:
     * @Description:自定义分页查询
     */
    PageOutput<NwfSchemeInfoVo> selectDataPage(GetPageListNwfTaskDto dto);

    /**
     * @Author:湘北智造-框架开发组
     * @Date:2020/10/20
     * @Param:[iPage, xjrNwfSchemeinfo]
     * @return:
     * @Description:自定义分页查询
     */
//    List<NwfSchemeInfoVo> selectData(GetPageListNwfTaskDto dto);

    /**
     * @Author:湘北智造-框架开发组
     * @Date:2020/10/21
     * @Param:[fId]
     * @return:boolean
     * @Description:删除流程模板及相关流程信息
     */
    boolean delete(String fId);

    /**
     * @Author:湘北智造-框架开发组
     * @Date:2020/10/26
     * @Param:[nwfSchemeInfoId, status]
     * @return:boolean
     * @Description:修改流程设计模板状态
     */
    boolean updateProcessStatus(String nwfSchemeInfoId, String status);

    /**
     * @Author:湘北智造-框架开发组
     * @Date:2020/10/27
     * @Param:[paramsMap, xjrBaseUser, list]
     * @return:boolean
     * @Description:保存流程模板设计
     */
    String saveProcess(NwfSchemeInfoDto dto, XjrUser currentUser) throws Exception;

    /**
     * @Author:湘北智造-框架开发组
     * @Date:2020/10/27
     * @Param:[paramsMap, xjrBaseUser, list]
     * @return:boolean
     * @Description:更新流程模板设计
     */
    boolean updateProcess(NwfSchemeInfoDto dto, XjrUser currentUser) throws Exception;

    /**
     * @Author:湘北智造-框架开发组
     * @Date:2020/11/10
     * @Param:[fId, deploymentId]
     * @return:boolean
     * @Description:更新部署ID
     */
    boolean updateDeploymentId(String fId, String deploymentId);

    /**
     * @Author:湘北智造-框架开发组
     * @Date:2020/11/25
     * @Param:[id]
     * @return:boolean
     * @Description:删除流程相关信息
     */
    void deleteProcess(String id) throws Exception;

    /**
     * @Author:湘北智造-框架开发组
     * @Date:2021/3/8
     * @Param:[id]
     * @return:java.lang.String
     * @Description:导出通用流程
     */
    File exportGeneralProcess(String id, Integer type);

    /**
    * @Author:湘北智造-框架开发组
    * @Date:2021/3/8
    * @Param:[id]
    * @return:java.lang.String
    * @Description:导入流程(json)
    */
    String importProcess(MultipartFile file) throws IOException;
}
